import httpRequest from '@/http/request'
const id = sessionStorage.getItem('id')
const email = sessionStorage.getItem('email')
export function apiUpdateUserMes(settingForm: object) {
    return httpRequest({
        url: '/web/user/updateUserMes',
        method: 'post',
        data: settingForm
    })
}

export function apiUploadAvater(formData: any) {
    let config = {
        headers: {
            "Content-Type": "multipart/form-data",
        },
    };
    return httpRequest.post(`/web/user/uploadAvater/${id}`, formData, config)
}

export function apiSendCode(email: any) {
    return httpRequest.get(`/web/user/sendCode/${email}/${id}`)
}

export function apiJudgeCode(code: string, password: string) {
    console.log(id, password)
    return httpRequest({
        url: `/web/user/judgeCode/${code}`,
        method: 'post',
        data: {
            id,
            password
        }
    })

}

export function apiUploadDetailFishPic(fishName: string, data: any) {
    return httpRequest({
        url: `http://120.77.156.205:8808/web/fishbaike/uploadDetailFishPic/${fishName}`,
        method: 'post',
        headers: {
            "Content-Type": "multipart/form-data",
        },
        data
    })
}